import type { App } from 'vue'
import { createRouter, createWebHashHistory, type RouteRecordRaw } from 'vue-router'

const RootRoute: RouteRecordRaw = {
  path: '/',
  name: 'Home',
  component: () => import('@/views/home/index.vue')
}
const constantRouter: RouteRecordRaw[] = [RootRoute]
const router = createRouter({
  history: createWebHashHistory(),
  routes: constantRouter,
  strict: true,
  scrollBehavior: () => ({ left: 0, top: 0 })
})

export function setupRouter(app: App) {
  app.use(router)
  // 创建路由守卫
  // createRouterGuards(router)
}
export default router
